-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE SP_LogoDetailDetailInsert
	@LogoDetailId int 
           ,@OrderNo int
           ,@FileName varchar(200)
AS
BEGIN
	INSERT INTO [dbo].[LogoDetailDetail]
           ([LogoDetailId]
           ,[OrderNo]
           ,[FileName])
     VALUES
           (@LogoDetailId
           ,@OrderNo
           ,@FileName)




END
GO

-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE SP_LogInformationInsert
	@CurrentDate Datetime
           ,@FarmanImage varchar(500)
           ,@HeaderImage varchar(500)
           ,@LogoImage varchar(500)
           ,@CreatedBy varchar(100)
           
           ,@CreatedDate datetime
AS
BEGIN
	INSERT INTO [dbo].[LogoInformation]
           ([CurrentDate]
           ,[FarmanImage]
           ,[HeaderImage]
           ,[LogoImage]
           ,[CreatedBy]
           
           ,[CreatedDate]
          )
     VALUES
           (@CurrentDate
           ,@FarmanImage
           ,@HeaderImage
           ,@LogoImage
           ,@CreatedBy
           
           ,@CreatedDate)
END
GO


/****** Object:  StoredProcedure [dbo].[SP_LogDetailInsert]    Script Date: 11/28/2011 23:25:15 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[SP_LogDetailInsert]
			@MenuId int
           ,@LogoInformationId int
           ,@NoOfFilePerPage int
AS
BEGIN
	INSERT INTO [dbo].[LogoDetail]
           ([MenuId]
           ,[LogoInformationId]
           ,[NoOfFilePerPage])
     VALUES
           (@MenuId
           ,@LogoInformationId
           ,@NoOfFilePerPage)




END


-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters 
-- command (Ctrl-Shift-M) to fill in the parameter 
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE SP_LogoInformationUpdate
	@CurrentDate Datetime
           ,@FarmanImage varchar(500)
           ,@HeaderImage varchar(500)
           ,@LogoImage varchar(500)
           ,@UpdatedBy varchar(100)
           
           ,@UpdatedDate datetime
           ,@Id int
AS
BEGIN
	UPDATE [dbo].[LogoInformation]
   SET [CurrentDate] = @CurrentDate
      ,[FarmanImage] = @FarmanImage
      ,[HeaderImage] = @HeaderImage
      ,[LogoImage] = @LogoImage
      
      ,[UpdatedBy] = @UpdatedBy
      
      ,[UpdatedDate] = @UpdatedDate
 WHERE Id= @Id




END
GO
USE [Azad]
GO
/****** Object:  StoredProcedure [dbo].[SP_LogoInformationUpdate]    Script Date: 11/29/2011 17:16:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
ALTER PROCEDURE [dbo].[SP_LogoInformationUpdate]
	@CurrentDate Datetime
           ,@FarmanImage varchar(500)
           ,@HeaderImage varchar(500)
           ,@LogoImage varchar(500)
           ,@UpdatedBy varchar(100)
           
           ,@UpdatedDate datetime
           ,@Id int
AS
BEGIN
Delete from logodetailDetail  where LogoDetailId in ( select id from logodetail ld where ld.LogoInformationId=@Id)
Delete from logodetail  where LogoInformationId=@Id

   UPDATE [dbo].[LogoInformation]
   SET [CurrentDate] = @CurrentDate
      ,[FarmanImage] = @FarmanImage
      ,[HeaderImage] = @HeaderImage
      ,[LogoImage] = @LogoImage
      
      ,[UpdatedBy] = @UpdatedBy
      
      ,[UpdatedDate] = @UpdatedDate
 WHERE Id= @Id




END
